<?php

namespace App\Http\Controllers\User;

use App\Models\Img;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class ImgController extends Controller
{
    public function index(){
        $id = Auth::user()->roles_id;
        if($id==1){
            $Imgs = Img::where(['active'=>'0'])->where('partid',Auth::user()->partid)->orderBy('id','desc')->paginate(10);
            return view('akl.admin.article_index', ['Imgs' => $Imgs]);
        }
        $article = Img::where(['users_id'=>Auth::user()->id,'active'=>'0'])->where('partid',Auth::user()->partid)->orderBy('id','desc')->paginate(10);
        return view('akl.admin.article_index')->with('article',$article);
    }

    public function create(){

    }

    public function store(){

    }

    public function destroy(){

    }



}
